Current computer applications are generally more graphically intense and involve a higher degree of graphics processing power than predecessors. Applications, such as games, typically involve complex and highly detailed graphics renderings that involve a substantial amount of ongoing computations. To match the demands made by consumers for increased graphics capabilities in computing applications, like games, computer configurations have also changed.
As computers, particularly personal computers, have been programmed to handle programmers' ever increasingly demanding entertainment and multimedia applications, such as high definition video and the latest 3D games, higher demands have likewise been placed on system bandwidth. Thus, methods have arisen to deliver the bandwidth for such bandwidth hungry applications, as well as providing additional bandwidth headroom for future generations of applications.
For these reasons, current computer systems oftentimes include multiple processors. For example, a graphics processing unit (GPU) is an example of a coprocessor in addition to a primary processor, such as a central processing unit (CPU), that performs specialized processing tasks for which it is designed. In performing these tasks, the GPU may free the CPU to perform other tasks. In some cases, coprocessors, such as a GPU, may actually reside on the computer system's motherboard along with the CPU, which may be a microprocessor. However, in other applications, as one of ordinary skill in the art would know, a GPU and/or other coprocessing devices may reside on a separate but electrically coupled card, such as a graphics card in the case of the GPU.
A coprocessor such as a GPU may often access supplemental memory, such as video memory, for performing its processing tasks. Coprocessors may be generally configured and optimized for performing specialized tasks. In the case of the GPU, such devices may be optimized for execution of three dimensional graphics calculations to support applications with intensive graphics. While conventional computer systems and coprocessors may adequately perform when running a single graphically intensive application, such computer systems and coprocessors may nevertheless encounter problems when attempting to execute multiple graphically intensive applications at once.
It is not uncommon for a typical coprocessor to schedule its processing workload in an inefficient manner. In some operating systems, a GPU may be multitasked using an approach that submits operations to the GPU in a serialized form such that the GPU executes the operations in the order in which they were received.
One problem with this approach is that it does not scale well when many applications with differing priorities access the same resources. In this nonlimiting example, a first application that may be currently controlling the resources of a GPU coprocessor needs to relinquish control to other applications for the other applications to accomplish their coprocessing objectives. If the first application does not relinquish control to the other waiting application, the GPU may be effectively tied up such that the waiting application is bottlenecked while the GPU finishes processing the calculations related to the first application. As indicated above, this may not be a significant bottleneck in instances where a single graphically intensive application is active; however, the problem of tying up a GPU or other coprocessor's resources may become more accentuated when multiple applications attempt to use the GPU or coprocessor at the same time.
The concept of apportioning processing between operations has been addressed with the concept of interruptible CPUs that context switch from one task to another. More specifically, the concept of context save/restore has been utilized by modern CPUs that operate to save the content of relevant registers and program counter data to be able to resume an interrupted processing task. While the problem of apportioning processing between the operations has been addressed in CPUs, where the sophisticated scheduling of multiple operations is utilized, scheduling for coprocessors has not been sufficiently addressed.
At least one reason for this failure is related to the fact that coprocessors, such as GPUs, are generally viewed as a resource to divert calculation-heavy and time consuming operations away from the CPU so that the CPU may be able to process other functions. It is well known that graphics operations can include calculation-heavy operations and therefore utilize significant processing power. As the sophistication of graphics applications has increased, GPUs have become more sophisticated to handle the robust calculation and rendering activities.
Yet, the complex architecture of superscalar and EPIC-type CPUs with parallel functional units and out-of-order execution has created problems for precise interruption in CPUs where architecture registers are to be renamed, and where several dozens of instructions are executed simultaneously in different stages of a processing pipeline. To provide for the possibility of precise interrupts, superscalar CPUs have been equipped with a reorder buffer and an extra stage of “instruction commit (retirement)” in the processing pipeline.
Current GPU are becoming more and more complex by including programmable and fixed function units connected by multiple FIFO-type buffers. Execution of each GPU command may take from hundreds to several thousand cycles. GPU pipelines used in today's graphics processing applications have become extremely deep in comparison to CPUs. Accordingly, most GPUs are configured to handle a large amount of data at any given instance, which complicates the task of attempting to apportion the processing of a GPU, as the GPU does not have a sufficient mechanism for handling this large amount of data in a save or restore operation.
Modern GPU configurations that have evolved so as to handle large amounts of data have taken upon complex shapes that involve new mechanisms for synchronization for the pipeline units in data stream processing. Using programmable parallel processing units in addition to main fixed function graphics pipeline units involves maintaining the order of graphics primitive data that may be received and updated in the different stages of the GPU pipeline. Plus, maintaining multiple contexts simultaneously with interruptability in the graphics pipeline of the GPU involves the resynchronization of such interrupted context with minimal performance loss and smooth switching between an interrupted and resumed graphics context. Current GPU configurations, however, do not handle synchronization of contexts well, instead resulting in a complete flush of the pipeline, thereby resulting in less efficient operation and reduced graphics capabilities.
Further, multi pass rendering when a GPU renders a surface that becomes a source surface for a next pass also involves synchronization to avoid RAW (read after write) data hazards when a second pass starts to access the shared surface. Plus, synchronization with CPU task execution when a GPU is supposed to start and/or resume a certain context execution depending upon events in CPU threads and current GPU context is also an issue in current GPU processing implementations. Yet, current CPUs are simply unable to communicate and respond to such changes in a timely manner so as to maintain pace with the increasing demands of graphics applications.
Thus, there is a heretofore-unaddressed need to overcome these deficiencies and shortcomings described above.